<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>编辑用户 - 若依语音通话系统</title>
    <link th:href="@{/css/style.css}" rel="stylesheet">
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>编辑用户</h1>
            <a th:href="@{/user/list}" class="btn btn-secondary">返回列表</a>
        </div>
        
        <div class="content">
            <form th:action="@{/user/update}" th:object="${user}" method="post" class="form">
                <input type="hidden" th:field="*{id}">
                <div class="form-group">
                    <label for="username">用户名</label>
                    <input type="text" id="username" name="username" th:field="*{username}" required>
                </div>
                <div class="form-group">
                    <label for="password">密码（留空表示不修改）</label>
                    <input type="password" id="password" name="password" placeholder="留空表示不修改密码">
                </div>
                <div class="form-group">
                    <label for="nickname">昵称</label>
                    <input type="text" id="nickname" name="nickname" th:field="*{nickname}" required>
                </div>
                <div class="form-group">
                    <label for="email">邮箱</label>
                    <input type="email" id="email" name="email" th:field="*{email}" required>
                </div>
                <div class="form-group">
                    <label for="phone">电话</label>
                    <input type="text" id="phone" name="phone" th:field="*{phone}">
                </div>
                <div class="form-group">
                    <label for="gender">性别</label>
                    <select id="gender" name="gender" th:field="*{gender}">
                        <option value="0">未知</option>
                        <option value="1">男</option>
                        <option value="2">女</option>
                    </select>
                </div>
                <div class="form-group">
                    <label for="status">状态</label>
                    <select id="status" name="status" th:field="*{status}">
                        <option value="1">启用</option>
                        <option value="0">禁用</option>
                    </select>
                </div>
                <div class="form-actions">
                    <button type="submit" class="btn btn-primary">更新</button>
                    <a th:href="@{/user/list}" class="btn btn-secondary">取消</a>
                </div>
            </form>
        </div>
    </div>
    <script th:src="@{/js/main.js}"></script>
</body>
</html>